home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
EditDialog.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-15
|
2KB
|
92 lines
#ifdef __GNUG__
#pragma implementation
#endif
#include "EditDialog.h"
#include "Class.h"
#include "Dialog.h"
#include "Scroller.h"
#include "VObjectText.h"
#include "VObjectTView.h"
#include "MenuBar.h"
#include "CommandProcessor.h"
#include "Window.h"
#include "Expander.h"
//---- EditDialog --------------------------------------------------------------
NewMetaImpl(EditDialog,Manager, (TP(textView), TP(tvClipper)));
EditDialog::EditDialog(char *t) : Manager(t)
{
}
EditDialog::~EditDialog()
{
SafeDelete(textView);
}
CommandProcessor *EditDialog::MakeCmdProcessor()
{
return new CommandProcessor1;
}
VObject *EditDialog::DoMakeContent()
{
Scroller *scroller= new Scroller(textView, Point(300, 200), cIdNone, eScrollRight);
tvClipper= scroller->GetClipper();
tvClipper->SetFlag(eVObjLayoutCntl);
return scroller;
}
/*
Window *EditDialog::DoMakeWindows()
{
VObject *inner= DoMakeContent();
menubar= DoMakeMenuBar();
if (menubar)
inner= new Expander(cIdNone, eVert, gPoint2, menubar, inner, 0);
return new Window(this, GetInitialWindowSize(), eWinBlock, inner, GetName());
}
*/
MenuBar *EditDialog::DoMakeMenuBar()
{
MenuBar *mb= Manager::DoMakeMenuBar();
mb->AddMenu(TextView::MakeMenu(cFONTMENU));
mb->AddMenu(TextView::MakeMenu(cSTYLEMENU));
mb->AddMenu(TextView::MakeMenu(cSIZEMENU));
mb->AddMenu(TextView::MakeMenu(cFORMATMENU));
return mb;
}
Point EditDialog::GetInitialWindowSize()
{
return Point(300, 200);
}
void EditDialog::Control(int id, int detail, void *data)
{
if (detail == cPartExtentChanged && data == (void*) tvClipper) {
int w= tvClipper->Width();
if (textView->Width() != w)
textView->SetWidth(w);
} else
Manager::Control(id, detail, data);
}
void EditDialog::ShowEditDialog(Text *text)
{
textView= new VObjectTextView(this, Rectangle(300,cFit), (VObjectText*) text);
OpenAt(0, GetInitialWindowPos(), TRUE, TRUE);
}
void EditDialog::ShowEditor(char *title, Text *t)
{
EditDialog *ed= new EditDialog(title);
ed->ShowEditDialog(t);
gSystem->AddCleanupObject(ed);
}